import request from '@/utils/request'

// 物流公司相关接口
export const getCompanyList = (params) => {
  return request({
    url: '/logistics/company',
    method: 'get',
    params
  })
}

export const addCompany = (data) => {
  return request({
    url: '/logistics/company',
    method: 'post',
    data
  })
}

export const updateCompany = (data) => {
  return request({
    url: '/logistics/company',
    method: 'put',
    data
  })
}

export const deleteCompany = (id) => {
  return request({
    url: `/logistics/company/${id}`,
    method: 'delete'
  })
}

// 物流价格相关接口
export const getPriceWithCompany = (params) => {
  return request({
    url: '/logistics/price/page',
    method: 'get',
    params
  })
}

export const addPrice = (data) => {
  return request({
    url: '/logistics/price',
    method: 'post',
    data
  })
}

export const updatePrice = (data) => {
  return request({
    url: '/logistics/price',
    method: 'put',
    data
  })
}

export const deletePrice = (id) => {
  return request({
    url: `/logistics/price/${id}`,
    method: 'delete'
  })
}